package qc.module.demo.mapper;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import qc.module.demo.dto.tsnumdata.TsNumDataDto;
import qc.module.demo.entity.TsNumData;

import java.util.List;

/**
 * TsNumDataMapper
 * @author YRR
 * @create 2025-04-11 15:37
 */
@Mapper
public interface TsNumDataMapper {
    TsNumDataMapper MAPPER = Mappers.getMapper(TsNumDataMapper.class);

    @Mapping(target = "tm", source = "tm", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @Mapping(target = "intm", source = "intm", dateFormat = "yyyy-MM-dd HH:mm:ss")
    TsNumDataDto toDto(TsNumData en);

    List<TsNumDataDto> toDtoList(List<TsNumData> list);

    @Mapping(target = "tm", ignore = true)
    @Mapping(target = "intm", ignore = true)
    TsNumData toEntity(TsNumDataDto dto);

}
